//
//  MySeeViewController.m
//  ForengnMenu
//
//  Created by @-@ on 16/1/19.
//  Copyright © 2016年 余旺. All rights reserved.
//

#import "MySeeViewController.h"
#import "MySeeTableViewCell.h"
#import "OtherInfoViewController.h"

@interface MySeeViewController ()<UITableViewDataSource,UITableViewDelegate>

@property NSArray * headerImages;

@property NSArray * Names;

@property NSArray * times;

@property NSArray * news;

@property NSArray * array;


@end

@implementation MySeeViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    
    self.headerImages = @[@"06",@"07",@"08"];
    self.Names = @[@"新东方厨师",@"导师",@"听说"];
    self.times = @[@"2015-12-03",@"2016-01-08",@"2016-01-18"];
    self.news = @[@"学厨师来新东方",@"我教你做菜",@"你们已经是好友了，赶快打声招呼吧"];

    
    NSDictionary * dic1 =@{@"image":@"06",
                           @"name" :@"新东方厨师",
                           @"sex":@"男 25岁 湖南 长沙",
                           @"title" :@" 账号信息:",
                           @"content" : @"124838753",
                           @"title1" : @"个性签名:",
                           @"content1" : @"我要娶个会炒菜的老婆",
                           @"title2" : @"他的二维码:",
                           @"content2" : @""

                           };
    
    NSDictionary * dic2 =@{@"image":@"07",
                           @"name" :@"导师",
                           @"sex":@"男 23岁 湖北 天津",
                           @"title" :@"账号信息:",
                           @"content" : @"364525375",
                           @"title1" : @"个性签名:",
                           @"content1" : @"学做菜就来找我吧",
                           @"title2" : @"他的二维码:",
                           @"content2" : @""
};

    NSDictionary * dic3 =@{@"image":@"08",
                           @"name" :@"听说",
                           @"sex":@"男 26岁 北京",
                           @"title" :@"账号信息:",
                           @"content" : @"563425327",
                           @"title1" : @"个性签名:",
                           @"content1" : @"幸福的家庭有你",
                           @"title2" : @"她的二维码:",
                           @"content2" : @""

                           };
    
    self.array = @[dic1,dic2,dic3];
    
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return self.headerImages.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString * identifier = @"cell";
    MySeeTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];

    cell.MySeeHeaderImage.image = [UIImage imageNamed:self.headerImages[indexPath.row]];
    cell.MySeeName.text = self.Names[indexPath.row];
    cell.MySeeTimeLabel.text = self.times[indexPath.row];
    cell.MySeeNewsLabel.text = self.news[indexPath.row];

    
    return cell;
}

//点击时触发
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    //取消选择状态
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    [self performSegueWithIdentifier:@"showOtherInfo" sender:self.array[indexPath.row]];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {


    OtherInfoViewController * controller = segue.destinationViewController;
    controller.info = sender;


}

@end
